//
//  PCXFile.h
//  MapEdit
//
//  Created by Steven Canfield on 30/06/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "NSColorAdditions.h"

struct PCXHeader {
	u_int8_t manufacturer;
	u_int8_t  version;
	u_int8_t  encoding;
	u_int8_t  bpp;
	u_int16_t min_x;
	u_int16_t min_y;
	u_int16_t max_x;
	u_int16_t max_y;
	u_int16_t horiz_DPI;
	u_int16_t vert_DPI;
	u_int8_t  colormap[48];
	u_int8_t  reserved;
	u_int8_t  planes;
	u_int16_t bpl;
	u_int16_t paletteInfo;
	u_int16_t horizScreenSize;
	u_int16_t vertScreenSize;
	u_int8_t  filler[54];
};
typedef struct PCXHeader PCXHeader;

@interface PCXFile : NSObject {
	PCXHeader header;
	u_int8_t *  bytes;
	u_int8_t *	palette;
	int XSIZE;
	int YSIZE;
}
- (id)initWithData:(NSData *)data;
- (NSColor *)colorAtX:(int)x Y:(int)y;
- (unsigned int*)pixelAtX:(int)x Y:(int)y;
@end
